import sys
import clutter

font_color = clutter.color_from_string("Black")
active_font_color = clutter.color_from_string("Red")
font_name = "Mono 32"
back_color = clutter.color_from_string("White")
box_back_color = clutter.color_from_string("Grey")

from touchwizard.canvas import Canvas

class AlwaysOnTop:
    def __init__ (self):
        self.canvas = c = Canvas(1024,768)
        #self.canvas.stage.set_fullscreen(True)
        c.add_icon(file="exit", launch_evt="quit", desc="Exit")

    def run(self):
        self.canvas.run()

    def add(self, actor):
        self.canvas.add_widget(actor)
    
def main (args):
    app = AlwaysOnTop()

    from mpd_cli import MpdController
    m = MpdController()

    from transilien import HorairesDisplayer
    h = HorairesDisplayer()
    h.set_position(m.get_width()+20, 0)

    from webradio import WebRadiosDisplayer
    w = WebRadiosDisplayer()
    w.set_position(m.get_width()+20+h.get_width()+20, 0)

    from rss import RSSDisplayer
    r = RSSDisplayer()
    x, y  = w.get_position()
    r.set_position(x + w.get_width() + 20, 0)

    app.add(m)
    app.add(h)
    app.add(w)
    app.add(r)
    app.run()
    return 0

if __name__ == '__main__':
    sys.exit(main(sys.argv[1:]))
